package com.matt.controller.sys;

import com.matt.commons.model.StatusResponse;
import com.matt.domain.courseV2.vo.*;
import com.matt.foundation.model.MemVerificationCache;
import com.matt.commons.page.PagerQuery;
import com.matt.service.courseV2.VendorCoursePackageService;
import com.matt.service.courseV2.VendorCourseService;
import com.matt.service.courseV2.VendorCourseTemplateService;
import com.matt.service.courseV2.VendorCourseTopicService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import static com.matt.foundation.constant.RequestConstant.TICKET;

@RestController
@RequestMapping(value = "/sys/course")
public class CourseManagerController {

    @Autowired
    private VendorCourseService courseService;

    @Autowired
    private VendorCoursePackageService coursePackageService;

    @Autowired
    private VendorCourseTopicService courseTopicService;

    @Autowired
    private VendorCourseTemplateService courseTemplateService;


    @Autowired
    MemVerificationCache cache;

    // TODO: 供应商管理
    @ApiOperation(value = "供应商列表",httpMethod = "GET")
    @RequestMapping(value = "/vendor/list", method = RequestMethod.GET)
    public StatusResponse getVendorList(@RequestHeader(TICKET) String ticket, PagerQuery pagerQuery) {
        return StatusResponse.success();
    }

    @ApiOperation(value = "增加或者更新供应商",httpMethod = "POST")
    @RequestMapping(value = "/verdor/update", method = RequestMethod.POST)
    public StatusResponse updateVendor(@RequestHeader(TICKET) String ticket, VendorVO vendor) {
        return StatusResponse.success();
    }

    @ApiOperation(value = "删除供应商",httpMethod = "POST")
    @RequestMapping(value = "/verdor/delete", method = RequestMethod.POST)
    public StatusResponse deleteVendor(@RequestHeader(TICKET) String ticket, String vendorId) {
        return StatusResponse.success();
    }

    // TODO：课程package管理
    @ApiOperation(value = "供应商的课程包列表",httpMethod = "GET")
    @RequestMapping(value = "/package/list", method = RequestMethod.GET)
    public StatusResponse packageList(@RequestHeader(TICKET) String ticket, String vendorId, PagerQuery pagerQuery) {
        return StatusResponse.success();
    }

    @ApiOperation(value = "课程包详情",httpMethod = "GET")
    @RequestMapping(value = "/package/detail", method = RequestMethod.GET)
    public StatusResponse packageDetail(@RequestHeader(TICKET) String ticket, String packageId) {
        return StatusResponse.success();
    }

    @RequestMapping(value = "/package/update", method = RequestMethod.POST)
    public StatusResponse updatePackage(@RequestHeader(TICKET) String ticket, VendorCoursePackageVO coursePackage) {
        return StatusResponse.success();
    }

    @RequestMapping(value = "/package/delete", method = RequestMethod.POST)
    public StatusResponse deletePackage(@RequestHeader(TICKET) String ticket, String packageId) {
        return StatusResponse.success();
    }

    // TODO： 模板管理
    @RequestMapping(value = "/template/list", method = RequestMethod.GET)
    public StatusResponse templateList(@RequestHeader(TICKET) String ticket, String vendorId) {
        return StatusResponse.success();
    }

    @RequestMapping(value = "/template/detail", method = RequestMethod.GET)
    public StatusResponse templateDetail(@RequestHeader(TICKET) String ticket, String templateId) {
        return StatusResponse.success();
    }


    @RequestMapping(value = "/template/update", method = RequestMethod.POST)
    public StatusResponse updateTemplate(@RequestHeader(TICKET) String ticket, VendorCourseTemplateVO courseTemplateVO) {
        return StatusResponse.success();
    }

    @RequestMapping(value = "/template/delete", method = RequestMethod.POST)
    public StatusResponse deleteTemplate(@RequestHeader(TICKET) String ticket, String templateId) {
        return StatusResponse.success();
    }

    // TODO: 主题管理
    @RequestMapping(value = "/topic/list", method = RequestMethod.GET)
    public StatusResponse topicList(@RequestHeader(TICKET) String ticket, String vendorId) {
        return StatusResponse.success();
    }

    @RequestMapping(value = "/topic/detail", method = RequestMethod.GET)
    public StatusResponse topicDetail(@RequestHeader(TICKET) String ticket, String topicId) {
        return StatusResponse.success();
    }

    @RequestMapping(value = "/topic/update", method = RequestMethod.POST)
    public StatusResponse updateTopic(@RequestHeader(TICKET) String ticket, VendorCourseTopicVO courseTopicVO) {
        return StatusResponse.success();
    }

    @RequestMapping(value = "/topic/delete", method = RequestMethod.POST)
    public StatusResponse deleteTopic(@RequestHeader(TICKET) String ticket, String topicId) {
        return StatusResponse.success();
    }

    // TODO: 课程管理
    @RequestMapping(value = "/vendor_course/list", method = RequestMethod.GET)
    public StatusResponse vendorCourseList(@RequestHeader(TICKET) String ticket, String vendorId, String packageId) {
        return StatusResponse.success();
    }

    @RequestMapping(value = "/vendor_course/detail", method = RequestMethod.GET)
    public StatusResponse vendorCourseDetail(@RequestHeader(TICKET) String ticket, String vendorCourseId) {
        return StatusResponse.success();
    }

    @RequestMapping(value = "/vendor_course/update", method = RequestMethod.POST)
    public StatusResponse updateVendorCourse(@RequestHeader(TICKET) String ticket, VendorCourseVO courseVO) {
        return StatusResponse.success();
    }

    @RequestMapping(value = "/vendor_course/delete", method = RequestMethod.POST)
    public StatusResponse deleteVendorCourse(@RequestHeader(TICKET) String ticket, String vendorCourseId) {
        return StatusResponse.success();
    }

}
